import type { AxiosRequestConfig, AxiosResponse } from "axios"

// 基础响应类型
export interface BaseResponse<T = any> {
    code: number
    message: string
    data: T
}

// 分页数据响应类型
export interface PaginationResponse<T = any> {
    list: T[]
    total: number
    page: number
    pageSize: number
}

// 扩展 axios 配置类型
export interface RequestConfig extends AxiosRequestConfig {
    showLoading?: boolean
    retry?: boolean
    retryCount?: number
    retryDelay?: number
}
// 错误类型
export interface RequestError extends Error {
    code?: number
    config?: AxiosRequestConfig
    request?: any
    response?: AxiosResponse
}